#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <string>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <iomanip>
#include <climits>
#define int long long 
#define x first 
#define y second 
using namespace std ;
typedef pair<int,int> PII;
const int N = 1e5 + 10;
const int mod = 998244353;
int a[N];
PII p[N];
int qmi(int a,int b,int p) //快速幂(求 a ^ b % p)
{
    int res = 1 % p;
    while(b)
    {
        if(b & 1) res = res * a % p;
        a = a * a % p;
        b >>= 1;
    }
    return res;
}
void solve()
{
     int n, m;
     cin >> n >> m;
     vector<int> arr;
     int x = m;
     for(int i = 2; i <= x /i; i++)
     {
        if(x % i == 0)
        {
            int s = 0;
            while(x % i == 0) x /= i,s++;
            arr.push_back(s);
        }
     }
     if(x > 1) arr.push_back(1);
     int res = 1;
     for(auto &c : arr)
     {
        int cnt = (qmi(c + 1,n,mod) - qmi(c,n,mod) + mod) % mod;// 16 - 9 = 7
        res = (res * cnt % mod) % mod; 
     }
     cout << res << endl;
}
signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr),cout.tie(nullptr);
    int t  = 1;
    //cin >> t;
    while(t -- ) solve();
    return 0;
}